<html>
<head><meta charset="utf-8"><title>how to use measureme crate? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20use.20measureme.20crate.3F.html">how to use measureme crate?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="234776219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20use%20measureme%20crate%3F/near/234776219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RY <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20use.20measureme.20crate.3F.html#234776219">(Apr 16 2021 at 00:29)</a>:</h4>
<p>trying to get profiling running without using DWARF call-graphs with perf, any ideas how to use the measureme crate?</p>



<a name="234860658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20use%20measureme%20crate%3F/near/234860658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20use.20measureme.20crate.3F.html#234860658">(Apr 16 2021 at 14:17)</a>:</h4>
<p><span class="user-mention" data-user-id="406121">@RY</span> Are you trying to use measureme inside rustc or a different program?</p>



<a name="234860747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20use%20measureme%20crate%3F/near/234860747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20use.20measureme.20crate.3F.html#234860747">(Apr 16 2021 at 14:17)</a>:</h4>
<p>Inside rustc, you can use the <code>-Zself-profile</code> flag to get a profile.</p>



<a name="234956720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20use%20measureme%20crate%3F/near/234956720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RY <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20use.20measureme.20crate.3F.html#234956720">(Apr 17 2021 at 03:48)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> i was able to figure out how to profile the compilation, but not sure if it supported profiling arbitrary program runtimes?</p>



<a name="234977673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20use%20measureme%20crate%3F/near/234977673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20use.20measureme.20crate.3F.html#234977673">(Apr 17 2021 at 10:14)</a>:</h4>
<p>since it's more of an instrumentation library that you use rather than a profiler, you can absolutely use it and its tools in your own programs. it's not solely limited to rustc</p>



<a name="234977701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20use%20measureme%20crate%3F/near/234977701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20use.20measureme.20crate.3F.html#234977701">(Apr 17 2021 at 10:15)</a>:</h4>
<p>you'd have to create an instance of its Profiler struct, and use that to publish events, or ask it to record intervals</p>



<a name="234977734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20use%20measureme%20crate%3F/near/234977734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20use.20measureme.20crate.3F.html#234977734">(Apr 17 2021 at 10:15)</a>:</h4>
<p>there is some documentation on how to do so here <a href="https://docs.rs/measureme/9.1.0/measureme/#writing-event-trace-files">https://docs.rs/measureme/9.1.0/measureme/#writing-event-trace-files</a></p>



<a name="234978537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20use%20measureme%20crate%3F/near/234978537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20use.20measureme.20crate.3F.html#234978537">(Apr 17 2021 at 10:28)</a>:</h4>
<p>(if you need different tools than it offers, say a timeline visualization of the events and intervals with filtering/stats, etc, but with a similar opt-in to mark events and regions of interest, there are a bunch of other choices, say <a href="https://github.com/wolfpld/tracy">https://github.com/wolfpld/tracy</a>)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>